<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>幻灯片</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="container-fluid" style="margin: 50px 100px">
    <div class="row">
        <div class="btn-group col-sm-4">
            <a class="btn btn-primary" href="{:url('goods.index/edit')}">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                添加商品</a>
            <a class="btn btn-primary" href="{:url('goods.index/add')}">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                快速添加商品</a>
            <a class="btn btn-primary" href="{:url('goods.category/edit')}">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                添加分类</a>
        </div>
        <form class="col-sm-8"action="{:url('goods.index/search')}" method="post" enctype="multipart/form-data">
            <div class="row">
                <div class="form-inline  col-sm-12 col-sm-offset-5">
                    <select class="form-control col-sm-3" name="enabled">
                        <option selected>商品分类</option>
                        <option value="生态种植">生态种植</option>
                        <option value="生态养殖">生态养殖</option>
                        <option value="...">...</option>
                    </select>
                    <input type="text" class="form-control col-sm-7" id="exampleInputEmail2" name="content" placeholder="ID/名称/编号/条码/商户号">
                    <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>搜索</button>
                </div>
            </div>
        </form>
    </div>
</div>

<div style="margin:50px 100px">
    <table class="table table-hover" style="width:100%">
        <tr>
            <th>店铺管理员</th>
            <th>商品</th>
            <th>售价</th>
            <th>原价</th>
            <th>销量</th>
            <th>库存</th>
            <th>操作</th>
        </tr>
        {foreach $items as $key=>$value}
        <tr>
            <td>{$value.user.rname}</td>
            <td>
                <div>
                    <img src="{$value.cover}" alt="无法显示图片" class="img-circle img-responsive" style="width: 100px;display: inline;vertical-align: middle;"/>
                    <div style="display: inline-block;vertical-align: middle">
                        <p><span><strong>商品名称</strong>:&emsp;{$value.name}</span></p>
                        <p><span><strong>商品分类</strong>:&emsp;{$value.category.name}</span></p>
                        <p><span><strong>商品详情</strong>:&emsp;{$value.details}</span></p>
                    </div>
                </div>
            </td>
            <td>{$value.price}</td>
            <td>{$value.ori_price}</td>
            <td>{$value.sales_num}</td>
            <td>{$value.stock}</td>
            <td>
                <a href="{:url('goods.index/edit')}?id={$value.id}">编辑</a>
                <a href="{:url('restore')}?id={$value.id}">恢复</a>
                <a href="{:url('remove')}?id={$value.id}">彻底删除</a>
            </td>
        </tr>
        {/foreach}
    </table>
</div>
<div style="margin: 10px 100px">{php}echo $page{/php}</div>

</body>
</html>